package com.wgchao.identityrightsmanagement.infrastructure.jpa.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;

/**
 * @ClassName: SysBaseAccount
 * @author: wgchao
 * @createTime: 2020/6/12 10:59 AM
 * @Description: 账户
 */
@Table(name = "sys_base_account", uniqueConstraints = @UniqueConstraint(columnNames = {"username"}))
@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysBaseAccount {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id" )
    private Long id;

    //唯一 账户名
    @Column(name = "username", length = 20)
    private String username;

    //密码
    @Column(name = "password", length = 200)
    private String password;

    //机构编号
    @Column(name = "agency_code", length = 20)
    private String agencyCode;

    //部门编号
    @Column(name = "department_code", length = 50)
    private String departmentCode;

    //账户名称
    @Column(name = "name", length = 50)
    private String name;

    //联系电话
    @Column(name = "contact_number", length = 20)
    private String contactNumber;

    //邮箱
    @Column(name = "email", length = 100)
    private String email;

    //描述/备注
    @Column(name = "description", length = 200)
    private String description;

    @Column(name = "account_type")
    private Integer accountType;

    //禁用标志
    @Column(name = "disabled")
    private boolean disabled;

    @Column(name = "creator", length = 20)
    private String creator;

    @Column(name = "create_time")
    private Date createTime;

    @Column(name = "last_updator", length = 20)
    private String lastUpdator;

    @Column(name = "last_update_time")
    private Date lastUpdateTime;

    @Column(name = "del")
    private Boolean del;

    @Version
    private Long version;
}
